package com.yuexun.dhdoctor.module.meeting.model.impl;

import com.yuexun.dhdoctor.module.meeting.api.MeetingApi;
import com.yuexun.dhdoctor.module.meeting.bean.MeetingBeanCheckBean;
import com.yuexun.dhdoctor.module.meeting.bean.MeetingCheckStateBean;
import com.yuexun.dhdoctor.module.meeting.bean.MeetingDetailBean;
import com.yuexun.dhdoctor.module.meeting.model.IMeetingDetailModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import java.util.Map;

import rx.Observable;

/**
 * Created by work-jx on 2016/11/15.
 */
public class MeetingDetailModel implements IMeetingDetailModel {
    private MeetingApi api;

    public MeetingApi ApiInstance() {
        if (api != null) {
            return api;
        } else {
            return ApiUtil.getInstance().createRetrofitApi(MeetingApi.class);
        }
    }

    @Override
    public Observable<MeetingDetailBean> getMeetingDetail(Map<String, String> praise) {
        api = ApiInstance();
        return api.getMeetingDetail(praise);
    }

    @Override
    public Observable<MeetingCheckStateBean> getMeetingCheckState(Map<String, String> praise) {
        api = ApiInstance();
        return api.getMeetingCheckState(praise);
    }

    @Override
    public Observable<MeetingBeanCheckBean> getMeetingCheck(Map<String, String> praise) {
        api = ApiInstance();
        return api.getMeetingCheck(praise);
    }

}
